<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FreeRTOS Addons: cpp_freertos::Deque Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FreeRTOS Addons
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecpp__freertos.html">cpp_freertos</a></li><li class="navelem"><a class="el" href="classcpp__freertos_1_1_deque.html">Deque</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcpp__freertos_1_1_deque-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">cpp_freertos::Deque Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="queue_8hpp_source.html">queue.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for cpp_freertos::Deque:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcpp__freertos_1_1_deque.png" usemap="#cpp_5Ffreertos::Deque_map" alt=""/>
  <map id="cpp_5Ffreertos::Deque_map" name="cpp_5Ffreertos::Deque_map">
<area href="classcpp__freertos_1_1_queue.html" alt="cpp_freertos::Queue" shape="rect" coords="0,0,128,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a16deb225bed6d4862d5806be94cadf8b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_deque.html#a16deb225bed6d4862d5806be94cadf8b">Deque</a> (UBaseType_t maxItems, UBaseType_t itemSize)</td></tr>
<tr class="separator:a16deb225bed6d4862d5806be94cadf8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92aa59429028a76e775087def340e80e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_deque.html#a92aa59429028a76e775087def340e80e">EnqueueToFront</a> (void *item, TickType_t Timeout=portMAX_DELAY)</td></tr>
<tr class="separator:a92aa59429028a76e775087def340e80e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a786e2a3c308172f5ca3a47704cc5b594"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_deque.html#a786e2a3c308172f5ca3a47704cc5b594">EnqueueToFrontFromISR</a> (void *item, BaseType_t *pxHigherPriorityTaskWoken)</td></tr>
<tr class="separator:a786e2a3c308172f5ca3a47704cc5b594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcpp__freertos_1_1_queue"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcpp__freertos_1_1_queue')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classcpp__freertos_1_1_queue.html">cpp_freertos::Queue</a></td></tr>
<tr class="memitem:a4feeb1d44cfb54613bad0e5fd2cb2fb4 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a4feeb1d44cfb54613bad0e5fd2cb2fb4">Queue</a> (UBaseType_t maxItems, UBaseType_t itemSize)</td></tr>
<tr class="separator:a4feeb1d44cfb54613bad0e5fd2cb2fb4 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00d119db8fa3050da37746e82cbcf94f inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a00d119db8fa3050da37746e82cbcf94f">~Queue</a> ()</td></tr>
<tr class="separator:a00d119db8fa3050da37746e82cbcf94f inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4713ec4c9c1410c11acacc4eca72fc18 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a4713ec4c9c1410c11acacc4eca72fc18">Dequeue</a> (void *item, TickType_t Timeout=portMAX_DELAY)</td></tr>
<tr class="separator:a4713ec4c9c1410c11acacc4eca72fc18 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa696d4b1334d00f72401b18cf45e178c inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#aa696d4b1334d00f72401b18cf45e178c">DequeueFromISR</a> (void *item, BaseType_t *pxHigherPriorityTaskWoken)</td></tr>
<tr class="separator:aa696d4b1334d00f72401b18cf45e178c inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaced379bf76eddf847560122b3cca012 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#aaced379bf76eddf847560122b3cca012">Enqueue</a> (const void *item)</td></tr>
<tr class="separator:aaced379bf76eddf847560122b3cca012 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeab8730af5a32a097758b5c35efb40f4 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#aeab8730af5a32a097758b5c35efb40f4">Enqueue</a> (const void *item, TickType_t Timeout)</td></tr>
<tr class="separator:aeab8730af5a32a097758b5c35efb40f4 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad514224ecf245093afae09ad05be6fea inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#ad514224ecf245093afae09ad05be6fea">EnqueueFromISR</a> (const void *item, BaseType_t *pxHigherPriorityTaskWoken)</td></tr>
<tr class="separator:ad514224ecf245093afae09ad05be6fea inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28f2419d245690501b0f94984e3e2a17 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a28f2419d245690501b0f94984e3e2a17">Flush</a> ()</td></tr>
<tr class="separator:a28f2419d245690501b0f94984e3e2a17 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afde637888866b4e1a9d3183c1747b3d3 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#afde637888866b4e1a9d3183c1747b3d3">IsEmpty</a> ()</td></tr>
<tr class="separator:afde637888866b4e1a9d3183c1747b3d3 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fc193db648de951c29d2a0efd517b1c inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a1fc193db648de951c29d2a0efd517b1c">IsFull</a> ()</td></tr>
<tr class="separator:a1fc193db648de951c29d2a0efd517b1c inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac434616f5ba6d27bae22fc20b78ccd49 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">UBaseType_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#ac434616f5ba6d27bae22fc20b78ccd49">NumItems</a> ()</td></tr>
<tr class="separator:ac434616f5ba6d27bae22fc20b78ccd49 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f1afbb10175767b684cf3e39bda94ee inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">UBaseType_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a6f1afbb10175767b684cf3e39bda94ee">NumSpacesLeft</a> ()</td></tr>
<tr class="separator:a6f1afbb10175767b684cf3e39bda94ee inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f53a7c5e542275d3e25c59002c04eb3 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a2f53a7c5e542275d3e25c59002c04eb3">Peek</a> (void *item, TickType_t Timeout=portMAX_DELAY)</td></tr>
<tr class="separator:a2f53a7c5e542275d3e25c59002c04eb3 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b8be750c74eba027576bcada410b2f8 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a0b8be750c74eba027576bcada410b2f8">PeekFromISR</a> (void *item)</td></tr>
<tr class="separator:a0b8be750c74eba027576bcada410b2f8 inherit pub_methods_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classcpp__freertos_1_1_queue"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classcpp__freertos_1_1_queue')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classcpp__freertos_1_1_queue.html">cpp_freertos::Queue</a></td></tr>
<tr class="memitem:a4b52f88d1cca486036905434f7867a48 inherit pro_attribs_classcpp__freertos_1_1_queue"><td class="memItemLeft" align="right" valign="top">QueueHandle_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_queue.html#a4b52f88d1cca486036905434f7867a48">handle</a></td></tr>
<tr class="separator:a4b52f88d1cca486036905434f7867a48 inherit pro_attribs_classcpp__freertos_1_1_queue"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Enhanced queue class that implements a double ended queue (a "deque"), almost. Unlike the traditional CommSci version, there is no way to dequeue from the back. Practically, this most likely isn't a big deal.</p>
<dl class="section note"><dt>Note</dt><dd>It is expected that an application will instantiate this class or one of the derived classes and use that. It is not expected that a user or application will derive from these classes. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a16deb225bed6d4862d5806be94cadf8b" name="a16deb225bed6d4862d5806be94cadf8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16deb225bed6d4862d5806be94cadf8b">&#9670;&#160;</a></span>Deque()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Deque::Deque </td>
          <td>(</td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>maxItems</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>itemSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Our constructor.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classcpp__freertos_1_1_queue_create_exception.html">QueueCreateException</a></td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">maxItems</td><td>Maximum number of items thsi queue can hold. </td></tr>
    <tr><td class="paramname">itemSize</td><td>Size of an item in a queue. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>FreeRTOS queues use a memcpy / fixed size scheme for queues. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a92aa59429028a76e775087def340e80e" name="a92aa59429028a76e775087def340e80e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a92aa59429028a76e775087def340e80e">&#9670;&#160;</a></span>EnqueueToFront()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Deque::EnqueueToFront </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TickType_t&#160;</td>
          <td class="paramname"><em>Timeout</em> = <code>portMAX_DELAY</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Add an item to the front of the queue. This will result in the item being removed first, ahead of all of the items added by the base calss <a class="el" href="classcpp__freertos_1_1_queue.html#a4713ec4c9c1410c11acacc4eca72fc18">Dequeue()</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item</td><td>The item you are adding. </td></tr>
    <tr><td class="paramname">Timeout</td><td>How long to wait to add the item to the queue if the queue is currently full. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the item was added, false if it was not. </dd></dl>

</div>
</div>
<a id="a786e2a3c308172f5ca3a47704cc5b594" name="a786e2a3c308172f5ca3a47704cc5b594"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a786e2a3c308172f5ca3a47704cc5b594">&#9670;&#160;</a></span>EnqueueToFrontFromISR()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Deque::EnqueueToFrontFromISR </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BaseType_t *&#160;</td>
          <td class="paramname"><em>pxHigherPriorityTaskWoken</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Add an item to the front of the queue. This will result in the item being removed first, ahead of all of the items added by the base calss <a class="el" href="classcpp__freertos_1_1_queue.html#a4713ec4c9c1410c11acacc4eca72fc18">Dequeue()</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item</td><td>The item you are adding. </td></tr>
    <tr><td class="paramname">pxHigherPriorityTaskWoken</td><td>Did this operation result in a rescheduling event. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the item was added, false if it was not. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="queue_8hpp_source.html">queue.hpp</a></li>
<li>src/freertos-addon/c++/cqueue.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
